package com.um.swing.ui;

import com.um.swing.common.inc.Constant;

import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPopupMenuUI;
import java.awt.*;


/**
 * popup menu ui.
 *
 * @author chenxin <chenxin619315@gmail.com>
 */
public class IPopupMenuUI extends BasicPopupMenuUI {

	public static ComponentUI createUI( JComponent c ) {
		return new IPopupMenuUI();
	}

	@Override
	public void installUI( JComponent c ) {
		super.installUI(c);
		c.setBorder(null);
	}

	@Override
	public void paint( Graphics g, JComponent comp ) {
		super.paint(g, comp);
		g.setColor(Constant.MAIN_BG_COLOR);
		g.fill3DRect(0, 0, comp.getWidth(), comp.getHeight(), true);
	}

}
